<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册界面</title>
</head>
<body>
	<script type="text/javascript" src="../static/jquery-3.3.1.min.js"></script>
	<script type="text/javascript">
function checkAccountExist(){
	var account = $("#account").val();
	if(account==""){
		alert("账户名不能为空");
		account.focus();
		return false;
	} else {
		$.ajax({
			  type: "POST",
			  url: "../CheckServlet?account=" + account,
			  data: {},
			  dataType: "json",
			  success: function(data) {
				  if(data==false){
					  $("#errMessage").html("当前账号信息已经存在");
				  } else {
					  $("#errMessage").html("");
				  }
			  }
			});
	}
}
</script>
	<h1>请输入用户信息</h1>
	<form action="CheckServlet" name="form" method="post">
		注册账号： <input type="number" id="account" name="account"
		onblur="checkAccountExist()" /><br /> 
		真实姓名： <input type="text" name="name" /><br /> 
		密码：<input type="password" name="pw"><br />
		<span id="errMessage" style="color: red;"></span> <br /> 
		<input type="submit" name="注册">
	</form>
</body>
</html>